﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BinaryTestProject
{
    class Program
    {
        static void Main(string[] args)
        {

            byte[] buffer = new byte[8] { 1, 0, 0, 0, 0, 0, 0, 2 };
            MemoryStream stream = new MemoryStream(buffer);
            stream.Position = 0;
            using (BinaryReader reader = new BinaryReader(stream))
            {
                int value1 = reader.ReadInt32();
                long pos1 = stream.Position;
                int value2 = reader.ReadInt32();
                long pos2 = stream.Position;
                Console.WriteLine(value1 + ", pos:" + pos1);
                Console.WriteLine(value2 + ", pos:" + pos2);
            }

            Console.Read();
        }
    }
}
